{% extends "ProjetForumBundle::layout.html.twig" %}

{% block title %}
	Acceuil - {{ parent() }}
{% endblock %}

{% block Forum_body %}
<script>

$(document).ready(function (){

	$('.sujet-content').hide();

	$('.cours-content').click(function(){

		$('.sujet-content',this).slideToggle('slow');

		});

});


</script>


{% for cours in entities %}
<br /><div class="cours-content btn max-width"><h3>Cours : {{ cours.nom }}</h3>


<table class="table sujet-content">
    <thead>
        <tr>
            <th>Sujet</th>
            <th>Date de création</th>
            <th>Visibilite</th>
            <th>Créé par</th>
            <th>Actions</th>
        </tr>
    </thead>
    <tbody>
    {% for entity in cours.sujets %}
        <tr>
            <td>{{ entity.nom }}</td>
            <td>{% if entity.createdat %}{{ entity.createdat|date('Y-m-d H:i:s') }}{% endif%}</td>
            <td>{{ entity.visibilite }}</td>
            <td>{{ entity.user }}</td>
            <td>
                <ul>
                    <li>
                        <a href="{{ path('sujet_show', { 'id': entity.id }) }}">show</a>
                    </li>
                </ul>
            </td>
        </tr>
    {% endfor %}
    </tbody>
</table>
</div>
{% endfor %}
{% endblock %}